package com.opennews.openplatform

class BankCard {
    String id
    AccountGroup accountGroup
    Bank bank
    String name
    String statementDate                // The example format: 15 means the 15th for each month.
    String paymentDueDate               // The example format: +3  means 3rd of next month as statementDate. 24 means 24th of same month as statementDate.
    String customerServiceNumber
    boolean isCreditCard = true
    boolean enabled = true
    Date dateCreated
    Date lastUpdated

    static constraints = {
        bank nullable: false
        accountGroup nullable: false
        name nullable: false, blank: false, maxSize: 50
        isCreditCard nullable: false
        statementDate nullable: true, blank: true, maxSize: 50
        paymentDueDate nullable: true, blank: true, maxSize: 50
        customerServiceNumber nullable: true, blank: true, maxSize: 50
    }

    static mapping = {
        version false
    }
}